﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Reflection.Emit;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace sy1_5
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            this.Icon = new Icon("icon.ico"); // 替换为你的图标文件路径（需放在bin\debug目录下）
            this.BackgroundImage = Image.FromFile("Azul.jpg"); // 载入时的背景图路径
            this.BackgroundImageLayout = ImageLayout.Stretch;
            label1.Visible = false;
        }
        private void Form1_Click(object sender, EventArgs e)
        {
            // 单击窗体时：切换背景图、隐藏标签
            this.BackgroundImage = Image.FromFile("butterfly.jpg"); // 单击时的背景图路径
            this.BackgroundImageLayout = ImageLayout.Stretch;
            label1.Visible = false;
        }

        private void Form1_DoubleClick(object sender, EventArgs e)
        {
            // 双击窗体时：切换背景图、显示标签
            this.BackgroundImage = Image.FromFile("flowers.jpg"); // 双击时的背景图路径
            this.BackgroundImageLayout = ImageLayout.Stretch;
            label1.Visible = true;
            label1.Text = "Hello!";
            label1.Font = new Font("微软雅黑", 20, FontStyle.Bold);
            label1.ForeColor = Color.White;
            label1.Location = new Point(150, 100);
        }
    }
}
